`ifndef TEST_SV
`define TEST_SV

`include "transaction.svh"

function automatic void rev(input transaction tr);
	tr.a = ~tr.a;
	tr = new(); // 不影响外部的对象句柄tr
endfunction

module automatic test;
	initial begin
		transaction tr;
		tr = new();
		tr.print();
		rev(tr);
		tr.print();
	end
endmodule

`endif
